#!/bin/bash

# backup old vim files.
date=`date '+%F_%T'`
vimr=~/.vimrc
vimd=~/.vim
if [[ -f "$vimr" && ! -L "$vimr" ]]; then
    mv "$vimr" "$vimr.$date"
fi
if [[ -d "$vimd" && ! -L "$vimd" ]]; then
	mv "$vimd" "$vimd.$date"
fi

### install new files
echo "* Install new vim files..."
# copy vim files
cp -r ./vim ~/.vim
cp ./vimrc ~/.vimrc
# remove subversion files
find ~/.vim -type d -name '.svn' | xargs rm -rf

### finish install
echo "* Install finished, enjoy yourself!"
